﻿cmake_minimum_required(VERSION 2.8)
project(liveMedia)
file(GLOB_RECURSE lib_hdrs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.hh)
file(GLOB_RECURSE lib_srcs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.c)
if(BUILD_DLL)
  add_definitions(-DBUILD_DLL -DEXP_LIB)
  add_library(${PROJECT_NAME} SHARED ${lib_srcs} ${lib_hdrs})
else()
  add_library(${PROJECT_NAME} STATIC ${lib_srcs} ${lib_hdrs})
endif()
target_include_directories(${PROJECT_NAME} PUBLIC ${SSL_INCLUDE_DIR} $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
target_link_libraries(${PROJECT_NAME} BasicUsageEnvironment ${SSL_LIBRARIES})
install(FILES ${lib_hdrs} DESTINATION include/${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-targets RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
install(EXPORT ${PROJECT_NAME}-targets DESTINATION lib/cmake FILE ${PROJECT_NAME}-config.cmake)
